package com.stars.services.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.stars.dao.ListPage;
import com.stars.dao.dto.TestDTO;
import com.stars.dao.mapper.test.TestMapper;
import com.stars.entity.TestEntity;
import com.stars.services.TestAccessServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName TestAccessServicesImpl
 * @Description:
 * @Author DJ
 * @Date 2019/12/26
 * @Version V1.0
 **/
@Service
public class TestAccessServicesImpl extends BaseAccessServiceImpl<TestMapper, TestEntity> implements TestAccessServices {
    @Autowired
    private TestMapper testMapper;
    @Override
    public PageInfo<TestDTO> pageList(Integer pageNum, Integer pageSize, TestDTO dto) throws Exception {
        ListPage<TestDTO> listPage = new ListPage<>(pageNum, pageSize, dto);
        PageHelper.startPage(pageNum, pageSize);
        List<TestDTO> list = testMapper.pageQueryTest(listPage);
        PageInfo<TestDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
